import React, { Component } from 'react'

export default class Father extends Component {
    state = {
        count: 100,
        user: {
            name: '英丽小姐姐',
            age: 20
        }
    }
    render() {
        const { count, user } = this.state
        return (
            <div>
                <p>count:{count}</p>
                <p onClick={() => {
                    this.setState({
                        user: {
                            ...this.state.user,
                            age: this.state.user.age + 1
                        }
                    })
                }}>user:{user.name}-{user.age}</p>
            </div>
        )
    }
}
